#ifndef CHECKSUM_H
#define CHECKSUM_H
#define BUFFSIZE 1024

// 计算ip校验和的简单实现,第一个元素为ip首部
unsigned short ip_checksum(unsigned short *buf, int len);

// 计算tcp校验和的辅助函数
unsigned short csum(unsigned short *ptr, int nbytes);

void tcp_checksum(struct iphdr *ipHeader, struct tcphdr *tcpHeader, char *data, int dataLen);

#endif